import request from '@/utils/request';

/** 商品列表模块API **/

//  商品列表API(分页列表)
export function GetStoreListByParams(params) {
    return request({
        url: '/cloudApi/goods/goods/getGoodsList',
        method: 'get',
        params
    })
}

//  删除单个商品API
export function DeleteStoreItem(data) {
    return request({
        url: '/cloudApi/goods/goods/removeGoods',
        method: 'post',
        data
    })
}

//  获取商品中心一个的商品详情
export function GetStoreItemDetail(params) {
    return request({
        url: '/cloudApi/goods/goods/getByGoodsId',
        method: 'get',
        params
    })
}

// SPU以及SKU编码的随机字符串获取
export function GetRandomString(params) {
    return request({
        url: '/cloudApi/goods/goods/getRandom',
        method: 'get',
        params
    })
}

export function GetStoreItemDetailNew(params) {
    return request({
        url: '/cloudApi/goods/goods/getGoodsDetail',
        method: 'get',
        params
    })
}

export function GetStoreItemDetailNewCopy(params) {
    return request({
        url: '/cloudApi/goods/goods/getGoodsInfo',
        method: 'get',
        params
    })
}

//  获取商品中心一个的商品详情 - 外部系统使用
export function GetStoreItemDetailMCH(params) {
    return request({
        url: '/cloudApi/goods/goods/getMchByGoods',
        method: 'get',
        params
    })
}

//  某一个商品详情的操作日志
export function GetStoreItemDetailLog(params) {
    return request({
        url: '/cloudApi/sys/log/getLogRecordList',
        method: 'get',
        params
    })
}

// 检测商品spu编码是否重复
export function CheckSPUCodeIsContain(params) {
    return request({
        url: '/cloudApi/goods/goods/checkRepeatedNo',
        method: 'get',
        params
    })
}

// 新增一个商品的基本信息
export function InsertStoreItem(data) {
    return request({
        url: '/cloudApi/goods/goods/insertGoods',
        method: 'post',
        data
    })
}

//  获取指定商品的SKU详情
export function GetSKUListById(params) {
    return request({
        url: '/cloudApi/goods/goods/getGoodsSkuList',
        method: 'get',
        params
    })
}

// 
export function InsertAndUpdateGoodsSKU(data) {
    return request({
        url: '/cloudApi/goods/goods/saveOrUpdateSkuBatch',
        method: 'post',
        data
    })
}

//  添加指定商品的SKU详情
export function InsertGoodsOneSKU(data) {
    return request({
        url: '/cloudApi/goods/goods/insertGoodsSKU',
        method: 'post',
        data
    })
}

//  修改指定商品的SKU详情
export function UpdateGoodsOneSKU(data) {
    return request({
        url: '/cloudApi/goods/goods/replaceGoodsSKU',
        method: 'post',
        data
    })
}

// 修改指定商品的SKU的上下架状态
export function UpdateGoodsOneSKUStatus(data) {
    return request({
        url: '/cloudApi/goods/goods/shelvesGoodsSku',
        method: 'post',
        data
    })
}

//  删除指定商品的SKU详情
export function RemoveGoodsOneSKU(data) {
    return request({
        url: '/cloudApi/goods/goods/removeGoodsSKU',
        method: 'post',
        data
    })
}

// 批量删除指定商品的SKU详情
export function RemoveGoodsSelectSKU(data) {
    return request({
        url: '/cloudApi/goods/goods/removeGoodsSKUBatch',
        method: 'post',
        data
    })
}

//  修改一个商品的基本信息
export function UpdateStoreItem(data) {
    return request({
        url: '/cloudApi/goods/goods/replaceGoods',
        method: 'post',
        data
    })
}

// 删除多个商品API
export function DeleteStoreItemBatch(params) {
    return request({
        url: '/cloudApi/goods/goods/removeGoodsBatch',
        method: 'post',
        data: params
    })
}

//  修改单个商品上/下架状态API
export function ChangeStoreItemStatus(data) {
    return request({
        url: '/cloudApi/goods/goods/shelvesGoods',
        method: 'post',
        data
    })
}

// 修改多个商品上/下架状态API
export function ChangeStoreItemListStatusBatch(data) {
    return request({
        url: '/cloudApi/goods/goods/shelvesGoodsBatch',
        method: 'post',
        data
    })
}

/** 商品品牌模块API **/
// 商品品牌列表API(分页列表)
export function GetStoreBrandListByParams(params) {
    return request({
        url: '/cloudApi/goods/goodsBrand/getGoodsBrandList',
        method: 'get',
        params
    })
}

// 商品品牌列表API(不分页列表)
export function GetStoreBrandAllListByParams(params) {
    return request({
        url: '/cloudApi/goods/goodsBrand/getGoodsBrandAll',
        method: 'get',
        params
    })
}

// 新增单个商品品牌API
export function SaveStoreBrandItem(data) {
    return request({
        url: '/cloudApi/goods/goodsBrand/saveGoodsBrand',
        method: 'post',
        data
    })
}

// 
export function GetStoreBrandDetail(params) {
    return request({
        url: '/cloudApi/goods/goodsBrand/getById',
        method: 'get',
        params
    })
}

// 修改单个商品品牌API
export function UpdateStoreBrandItem(data) {
    return request({
        url: '/cloudApi/goods/goodsBrand/updateGoodsBrand',
        method: 'post',
        data
    })
}

// 删除单个商品品牌API
export function RemoveStoreBrandItem(data) {
    return request({
        url: '/cloudApi/goods/goodsBrand/removeGoodsBrand',
        method: 'post',
        data
    })
}

//  修改单个商品品牌上/下架状态API
export function ChangeStoreBrandItemStatus(data) {
    return request({
      url: '/cloudApi/goods/goodsBrand/updateGoodsBrand',
      method: 'post',
      data
    })
  }


/** 商品标签模块API **/
// 商品标签列表API(分页列表)
export function GetStoreTagListByParams(params) {
    return request({
        url: '/cloudApi/goods/goodsTag/getTagList',
        method: 'get',
        params
    })
}

// 商品标签列表API(不分页列表)
export function GetStoreTagAllListByParams(params) {
    return request({
        url: '/cloudApi/goods/goodsTag/getTagListAll',
        method: 'get',
        params
    })
}

//  修改单个商品标签API
export function SaveStoreTagItem(data) {
    return request({
        url: '/cloudApi/goods/goodsTag/saveTag',
        method: 'post',
        data
    })
}

//  删除单个商品标签API
export function DeleteStoreTagItem(data) {
    return request({
        url: '/cloudApi/goods/goodsTag/removeTag',
        method: 'post',
        data
    })
}

/** 商品属性模块API **/
// 商品属性列表API(分页列表)
export function GetStoreAttrListByParams(params) {
    return request({
        url: '/cloudApi/goods/goodsProperties/getPropertiesList',
        method: 'get',
        params
    })
}

// 更改属性的状态
export function ChangeStoreAttrStatus(data) {
    return request({
        url: '/cloudApi/goods/goodsProperties/propertiesStatus',
        method: 'post',
        data
    })
}

// 商品属性列表API(不分页列表)
export function GetStoreAttrListAllByParams(params) {
    return request({
        url: '/cloudApi/goods/goodsProperties/getPropertiesAll',
        method: 'get',
        params
    })
}

// 删除单个商品属性列表API
export function DeleteStoreAttrItem(data) {
    return request({
        url: '/cloudApi/goods/goodsProperties/removeProperties',
        method: 'post',
        data
    })
}

// 获取单个商品属性对应的属性值列表
export function GetStoreAttrItemValueList(params) {
    return request({
        url: '/cloudApi/goods/goodsProperties/getPropertiesValueList',
        method: 'get',
        params
    })
}

// 获取单个属性值的详情
export function GetStoreAttrItemDetail(params) {
    return request({
        url: '/cloudApi/goods/goodsProperties/getByProperties',
        method: 'get',
        params
    })
}

// 获取单个属性绑定的分类列表
export function GetStoreAttrItemBindClass(params) {
    return request({
        url: '/cloudApi/goods/goodsProperties/getBindCategoryList',
        method: 'get',
        params
    })
}

// 添加商品属性的单个属性值
export function AddStoreAttrItemValueOne(data) {
    return request({
        url: '/cloudApi/goods/goodsProperties/saveProperties',
        method: 'post',
        data
    })
}

// 添加自定义商品属性的单个属性值
export function AddCustomStoreAttrItemValueOne(data) {
    return request({
        url: '/cloudApi/goods/goodsProperties/saveCustomProperties',
        method: 'post',
        data
    })
}

// 修改商品属性的单个属性值
export function UpdateStoreAttrItemValueOne(data) {
    return request({
        url: '/cloudApi/goods/goodsProperties/updateProperties',
        method: 'post',
        data
    })
}

// 修改商品属性的单个属性
export function EditCustomStoreAttrItemOne(data) {
    return request({
        url: '/cloudApi/goods/goodsProperties/updateCustomProperties',
        method: 'post',
        data
    })
}

// 修改商品属性的单个属性值
export function EditCustomStoreAttrItemValueOne(data) {
    return request({
        url: '/cloudApi/goods/goodsProperties/saveCustomPropertyValues',
        method: 'post',
        data
    })
}

// 删除自定义商品属性
export function DeleteCustomStoreAttrItemOne(data) {
    return request({
        url: '/cloudApi/goods/goodsProperties/removeCustomProperties',
        method: 'post',
        data
    })
}

// 删除自定义商品属性
export function DeleteCustomStoreAttrItemValueOne(data) {
    return request({
        url: '/cloudApi/goods/goodsProperties/removeCustomPropertyValues',
        method: 'post',
        data
    })
}

// 删除商品属性的单个属性值
export function DeleteStoreAttrItemValueOne(data) {
    return request({
        url: '/cloudApi/goods/goodsProperties/removePropertyValues',
        method: 'post',
        data
    })
}

// 插入单个商品属性
export function InsertProperties(data) {
    return request({
        url: '/cloudApi/goods/goodsProperties/insertProperties',
        method: 'post',
        data
    })
}

// 插入单个属性值
export function InsertPropertyValues(data) {
    return request({
        url: '/cloudApi/goods/goodsProperties/insertPropertyValues',
        method: 'post',
        data
    })
}

/** 商品分类模块API **/
//  获取商品属性列表
export function GetStoreClassList(params) {
    return request({
        url: '/cloudApi/goods/goodsCategory/getGoodsCategoryList',
        method: 'get',
        params
    })
}

//  保存商品属性详情
export function SaveStoreClass(data) {
    return request({
        url: '/cloudApi/goods/goodsCategory/saveGoodsCategory',
        method: 'post',
        data
    })
}

//  编辑商品属性详情
export function EditStoreClass(data) {
    return request({
        url: '/cloudApi/goods/goodsCategory/updateGoodsCategory',
        method: 'post',
        data
    })
}

// 获取商品属性详情
export function GetStoreClassDetail(params) {
    return request({
        url: '/cloudApi/goods/goodsCategory/getById',
        method: 'get',
        params
    })
}

// 删除商品属性
export function RemoveStoreClass(data) {
    return request({
        url: '/cloudApi/goods/goodsCategory/removeGoodsCategory',
        method: 'post',
        data
    })
}

/** 供应商模块API **/
// 供应商列表API(分页列表)
export function GetStoreSupplyListByParams(params) {
    return request({
        url: '/cloudApi/goods/goodsSupplier/getGoodsSupplierList',
        method: 'get',
        params
    })
}

// 供应商列表API(不分页列表)
export function GetStoreSupplyListAll(params) {
    return request({
        url: '/cloudApi/goods/goodsSupplier/getList',
        method: 'get',
        params
    })
}

// 更改供应商的状态
export function ChangeStoreSupplyStatus(params) {
    return request({
        url: '/cloudApi/goods/goodsSupplier/goodsSupplierStatus',
        method: 'get',
        params
    })
}

// 添加供应商信息
export function SaveStoreSupply(data) {
    return request({
        url: '/cloudApi/goods/goodsSupplier/saveGoodsSupplier',
        method: 'post',
        data
    })
}

// 获取供应商信息
export function GetStoreSupplyOneItem(params) {
    return request({
        url: '/cloudApi/goods/goodsSupplier/getByGoodsSupplierId',
        method: 'get',
        params
    })
}

// 修改供应商信息
export function UpdateStoreSupply(data) {
    return request({
        url: '/cloudApi/goods/goodsSupplier/updateGoodsSupplier',
        method: 'post',
        data
    })
}

// 删除供应商信息
export function RemoveStoreSupply(data) {
    return request({
        url: '/cloudApi/goods/goodsSupplier/removeGoodsSupplier',
        method: 'post',
        data
    })
}

// 同商品下批量添加采销商品Sku
export function SaveGoodsSkuBatch(data) {
    return request({
        url: '/cloudApi/goods/wholesale/saveGoodsSkuBatch',
        method: 'post',
        data
    })
}

// 编辑商品的营销信息
export function UpdateGoodsMarketing(data) {
    return request({
        url: '/cloudApi/goods/goods/saveOrUpdateMarketing',
        method: 'post',
        data
    })
}

// 获取全部的渠道数据
export function GetGoodsChanelListAll(params) {
    return request({
        url: '/cloudApi/merchant/channel/getChannelAll',
        method: 'get',
        params
    })
}

// 获取商品/品牌的资料包
export function GetGoodsZipList(params) {
    return request({
        url: '/cloudApi/goods/resourcezip/getResourceZipList',
        method: 'get',
        params
    })
}

// 批量添加商品/品牌的资料包
export function InsertGoodsZipList(data) {
    return request({
        url: '/cloudApi/goods/resourcezip/saveResourceZip',
        method: 'post',
        data
    })
}

// 批量删除商品/品牌的资料包
export function UpdateGoodsZipList(data) {
    return request({
        url: '/cloudApi/goods/resourcezip/updateResourceZip',
        method: 'post',
        data
    })
}

// 导出商品信息
export function ExportStoreList(params) {
    return request({
        url: '/cloudApi/goods/excel/exportGoodsSku',
        method: 'get',
        params
    })
}

// 导出商品品牌信息
export function ExportStoreBrandList(params) {
    return request({
        url: '/cloudApi/goods/goodsBrand/exportGoodsBrand',
        method: 'get',
        params
    })
}

//获取价格模板列表
export function GetPriceList(params) {
    return request({
        url: '/cloudApi/goods/goodsPriceTemp/getTempList',
        method: 'get',
        params
    })
}

// 获取所有的价格模板
export function GetAllStorePriceModel(params) {
    return request({
        url: '/cloudApi/goods/goodsPriceTemp/getTempAll',
        method: 'get',
        params
    })
}

//获取所有价格类型
export function GetPriceAll(params) {
    return request({
        url: '/cloudApi/goods/goodsPriceTemp/getTempAll ',
        method: 'get',
        params
    })
}

//新增或编辑价格模板
export function UpdatePriceList(data) {
    return request({
        url: '/cloudApi/goods/goodsPriceTemp/saveTemp',
        method: 'post',
        data
    })
}

//删除价格模板
export function RemovePriceList(data) {
    return request({
        url: '/cloudApi/goods/goodsPriceTemp/removeTemp',
        method: 'post',
        data
    })
}

//  修改单个价格模板状态API
export function ChangeStorePriceItemStatus(data) {
    return request({
      url: '/cloudApi/goods/goodsPriceTemp/saveTemp',
      method: 'post',
      data
     })
}

//获取渠道列表
export function GetChannelList(params) {
    return request({
        url: '/cloudApi/merchant/channel/getChannelList',
        method: 'get',
        params
    })
}

//新增渠道
export function AddChannelItem(data) {
    return request({
      url: '/cloudApi/merchant/channel/save',
      method: 'post',
      data
     })
}

//修改和更新渠道信息
export function UpdateChannelItem(data) {
    return request({
      url: '/cloudApi/merchant/channel/updateById',
      method: 'post',
      data
     })
}

//通过id删除渠道信息
export function RemoveChannelItem(data) {
    return request({
      url: '/cloudApi/merchant/channel/removeById',
      method: 'post',
      data
     })
}

//通过id进行批量删除
export function RemoveChannelItems(data) {
    return request({
      url: '/cloudApi/merchant/channel/removeByIds',
      method: 'post',
      data
     })
}

// 绑定分类
export function BindCategory(data) {
    return request({
      url: '/cloudApi/goods/goodsProperties/bindCategory',
      method: 'post',
      data
     })
}

// 解绑分类
export function UnBindCategory(data) {
    return request({
        url: '/cloudApi/goods/goodsProperties/unbindCategory',
        method: 'post',
        data
     })
}

//通过ID获取渠道详情
export function GetChannelListItem(params) {
    return request({
        url: '/cloudApi/merchant/channel/getById',
        method: 'get',
        params
    })
}

//通过ID获取渠道详情
export function GetMerchantChannelAll(params) {
    return request({
        url: '/cloudApi/merchant/merchantChannel/getMerchantChannelAll',
        method: 'get',
        params
    })
}

//通过ID获取渠道详情
export function GetStoreChannelAll(params) {
    return request({
        url: '/cloudApi/merchant/storeChannel/getStoreChannelAll',
        method: 'get',
        params
    })
}

//获取税率税码列表
export function GetFinicalDataList(params) {
    return request({
        url: '/cloudApi/goods/taxCode/getTaxCodeList',
        method: 'get',
        params
    })
}

// 税率绑定分类
export function BindFincialCategory(data) {
    return request({
        url: '/cloudApi/goods/taxCode/bindCategory',
        method: 'post',
        data
     })
}

//获取分类绑定的税率税码列表
export function GetFinicalBindList(params) {
    return request({
        url: '/cloudApi/goods/taxCode/getCategory',
        method: 'get',
        params
    })
}

// 获取尺码模板列表(分页)
export function GetSizeList(params) {
    return request({
        url: '/cloudApi/goods/sizeTemplate/getTemplateList',
        method: 'get',
        params
    })
}

// 获取尺码模板列表（不分页）
export function GetSizeListCopy(params) {
    return request({
        url: '/cloudApi/goods/sizeTemplate/getAllTemplateList',
        method: 'get',
        params
    })
}

// 新增尺码模板
export function AddSizeModules(data) {
    return request({
        url: '/cloudApi/goods/sizeTemplate/saveTemplate',
        method: 'post',
        data
     })
}

// 编辑尺码模板
export function UpdateSizeModules(data) {
    return request({
        url: '/cloudApi/goods/sizeTemplate/updateTemplate',
        method: 'post',
        data
     })
}

// 删除尺码模板
export function RemoveSizeModules(data) {
    return request({
        url: '/cloudApi/goods/sizeTemplate/removeTemplate',
        method: 'post',
        data
     })
}

// 修改尺码模板的状态
export function UpdateSizeStatus(data) {
    return request({
        url: '/cloudApi/goods/sizeTemplate/updateStatus',
        method: 'post',
        data
     })
}

// 获取sku列表
export function GetSkuList(params) {
    return request({
        url: '/cloudApi/goods/sku/getSkuList',
        method: 'get',
        params
    })
}

// 查询商品绑定尺码模板
export function GetGoodBindedSize(params) {
    return request({
        url: '/cloudApi/goods/sizeTemplate/getGoodsBindTemplate',
        method: 'get',
        params
    })
}

// 获取内部供应商的编码（自动生成）
export function GetInRandomCode(params) {
    return request({
        url: '/cloudApi/goods/goodsSupplier/getRandomCode',
        method: 'get',
        params
    })
}

// 修改商品上下架的状态（新的接口  如果所有的sku的库存都为0的时候不允许上架）
export function UpdateShelveStatus(data) {
    return request({
        url: '/cloudApi/goods/goods/saveOrUpdateMarketing',
        method: 'post',
        data
     })
}





